package com.jwaoo.chat.fragment.session.model;

import android.content.Context;

import com.dx.as.common.ILoadListener;
import com.dx.as.db.IDBListener;
import com.dx.as.db.SqlLiteHelper;
import com.jwaoo.chat.ChatConstants;
import com.jwaoo.chat.data.db.ChatDatabase;
import com.jwaoo.chat.data.db.MessageHandler;
import com.jwaoo.chat.fragment.session.bean.SessionBean;

import java.util.List;

import http.IHttpListener;

import static com.jwaoo.chat.data.db.MessageHandler.GET_SESSION;

/**
 * Created by jwaoo on 2017/7/3.
 */

public class SessionModel extends IHttpListener{

    private Context mContext;
    private ILoadListener loadListener;
    public SessionModel(Context context, ILoadListener loadListener) {
        super(context,loadListener);
        this.mContext = context;
        this.loadListener = loadListener;
    }

    @Override
    public void getData(Object... objects) {
        fromDB();
    }

    @Override
    public void onResponse(Object response, int flg) {

    }

    @Override
    public void onFailure(Throwable t) {

    }

    private void fromDB(){
        MessageHandler.getInstace(mContext).handlerMessages(GET_SESSION,loadListener);
    }
}
